-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement RFC 1047 - socket timeouts #25818
Conversation
// Timeouts | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#[cfg(target_os = "windows")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this platform-specific code into src/libstd/sys/{unix,windows}/net.rs ?
Nice! Could you also add some tests that exercise the I/O portion of timeouts? For example:
|
Updated. The time comparisons in the new tests are pretty lax, but I didn't want them to flicker and it still makes sure it doesn't immediately return and doesn't block for way too long. I couldn't really think of a reasonable way to test write timeouts unfortunately since the kernel will buffer writes. |
@bors try |
💔 Test failed - try-mac |
@bors try |
⌛ Trying commit 6768ca9 with merge ee47d85... |
|
||
/// Returns the read timeout of this socket. | ||
/// | ||
/// If the timeout is `None`, then `read` calls will block indefinitely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these docs also mention that not all platforms support accessing the read/write timeouts, even if they have been set successfully?
r=me once tests are passing, thanks @sfackler! |
@bors try Should be good to go now, but I'll run it past try one more time. |
@bors try |
⌛ Trying commit 69a0e1a with merge 991249b... |
💔 Test failed - try-linux |
@bors try |
⌛ Trying commit e632166 with merge 1864973... |
💔 Test failed - try-win-gnu-64 |
⌛ Testing commit 494901a with merge d8b877c... |
💔 Test failed - auto-linux-64-x-android-t |
⌛ Testing commit b5c6c7e with merge b9daa8f... |
💔 Test failed - auto-linux-64-opt |
@bors retry |
Closes #25619
r? @alexcrichton